package com.weiyuwqj.web;

import com.weiyuwqj.api.util.IpUtils;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

public class SimpleCORSFilter implements Filter {
  public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {

    HttpServletRequest request=(HttpServletRequest)req;
    IpUtils.set(request);
    chain.doFilter(req, res);
    IpUtils.clear();
  }
  public void init(FilterConfig filterConfig) {}
  public void destroy() {}
}
